package com.strato.mvc.api.v1_0_0.user;

public class UserContext {

	private static ThreadLocal<String> tl=new ThreadLocal<String>();
	
	private static ThreadLocal<Object> tlu=new ThreadLocal<Object>();
	
	private static ThreadLocal<Principal> tlp=new ThreadLocal<Principal>();
	
	public static void setUser(Object user){
		tlu.set(user);
	}
	
	public static Object getUser(){
		return tlu.get();
	}
	
	public static void set(String userId){
		tl.set(userId);
	}
	
	public static String get(){
		return tl.get();
	}
	
	public static Principal getPrincipal(){
		return tlp.get();
	}
	
	public static void setPrincipal(Principal p){
		tlp.set(p);
	}
}
